package com.testmanager.testmananger.quantitative.constants;

import com.testmanager.testmananger.foundation.domain.enums.EnumBase;

import java.util.Arrays;

public enum BugLevel implements EnumBase {
    BLOCK("阻塞",1),
    SERIOUS("严重",2),
    GENERAL("一般",3),
    SLIGHT("轻微",4)

    ;

    private final String name;
    private final Integer value;
    BugLevel(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public static BugLevel getValueOf(Integer value){

        return Arrays.stream(BugLevel.values())
                .filter(t->t.getValue().equals(value))
                .findFirst()
                .orElse(BugLevel.GENERAL);
    }




}
